﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using t_205_verk_hopur_12.Models;

namespace t_205_verk_hopur_12.Tests.Fakes
{
    public class FakeChannelRepository : IChannelRepository
    {

        private List<Channel> channelList;

        public FakeChannelRepository(List<Channel> channels)
        {
            channelList = channels;
        }



        public void Add(Channel newChannel)
        {
            channelList.Add(newChannel);
        }

        public void AddAnnouncements(Announcement newAnn)
        {
            throw new NotImplementedException();
        }

        public void AddVideoToElection(VideoElection newElection)
        {
            throw new NotImplementedException();
        }

        public void ApplyAtChannel(Application newApp)
        {
            throw new NotImplementedException();
        }

        public void EndElection(int channelID, int videoID)
        {
            throw new NotImplementedException();
        }

        public Announcement GetAnnouncementByAnnouncementID(int id)
        {
            throw new NotImplementedException();
        }

        public IQueryable<Announcement> GetAnnouncementsByID(int channelID)
        {
            List<Announcement> fakecat = new List<Announcement>();
            fakecat.Add(new Announcement() { ID = 1, ChannelID = 1, Title ="bla", Body = "bla bla bla" });
            fakecat.Add(new Announcement() { ID = 2, ChannelID = 1, Title = "bla", Body = "bla bla bla" });
            IQueryable<Announcement> x = (from y in fakecat
                                      select y).AsQueryable();

            return x;
        }

        public Application GetApplicationByUserIdAndChannelId(int userID, int channelID)
        {
            throw new NotImplementedException();
        }

        public IQueryable<User> GetApplicationsByChannelID(int channelID)
        {
            throw new NotImplementedException();
        }

        public Channel GetChannelByID(int ID)
        {
            return channelList.SingleOrDefault(c => c.ID == ID);
        }

        public IQueryable<ChannelComment> GetChannelComentsByID(int channelID)
        {
            throw new NotImplementedException();
        }

        public IQueryable<VideoElection> GetElectionsByChannelId(int channelID, int userID)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<User> GetEmployeesByChannelId(int channelID)
        {
            throw new NotImplementedException();
        }

        public IQueryable<Channel> GetHighestRated()
        {
            throw new NotImplementedException();
        }

        public Permission GetPermissionByUserIdAndChannelId(int userID, int channelID)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<ChannelSearchViewModel> GetSearchResults(string query, string sort, string by)
        {
            throw new NotImplementedException();
        }

        public Subscription GetSubscriptionsByUserAndChannel(int userID, int channelID)
        {
            throw new NotImplementedException();
        }

        public IQueryable<Channel> GetTop4Channels()
        {
            List<Channel> fakecat = new List<Channel>();
            fakecat.Add(new Channel() { ID = 1, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 2, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 3, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 4, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            IQueryable<Channel> x = (from y in fakecat
                                          select y).AsQueryable();

            return x;
        }

        public IQueryable<Channel> GetTop4ChannelsYouOwn(int userID)
        {
            List<Channel> fakecat = new List<Channel>();
            fakecat.Add(new Channel() { ID = 1, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 2, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 3, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 4, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            IQueryable<Channel> x = (from y in fakecat
                                     select y).AsQueryable();

            return x;
        }

        public IQueryable<Channel> GetTop4SubscribedChannels(int userID)
        {
            List<Channel> fakecat = new List<Channel>();
            fakecat.Add(new Channel() { ID = 1, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 2, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 3, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            fakecat.Add(new Channel() { ID = 4, OwnerID = 1, Name = "bla", Description = "bla bla bla" });
            IQueryable<Channel> x = (from y in fakecat
                                     select y).AsQueryable();

            return x;
        }

        public IQueryable<Video> GetVideoInElectionState(int channelID)
        {
            throw new NotImplementedException();
        }

        public bool HasApplied(int userID, int channelID)
        {
            throw new NotImplementedException();
        }

        public bool HasUserVotedChannel(ChannelVote channelVote)
        {
            throw new NotImplementedException();
        }

        public void HireEmployee(Permission pm)
        {
            throw new NotImplementedException();
        }

        public bool IsEmployee(int userID, int channelID)
        {
            throw new NotImplementedException();
        }

        public bool IsOwnerOrEmployee(int userID, int channelID)
        {
            throw new NotImplementedException();
        }

        public bool IsSubscribed(int userID, int channelID)
        {
            throw new NotImplementedException();
        }

        public void RemoveApplication(Application app)
        {
            throw new NotImplementedException();
        }

        public void RevokePermission(Permission pm)
        {
            throw new NotImplementedException();
        }

        public void Save()
        {
            throw new NotImplementedException();
        }

        public void SaveElectionByUserId(int userID, int key, int value)
        {
            throw new NotImplementedException();
        }

        public void SetVideoStatus(int videoID, int state)
        {
            throw new NotImplementedException();
        }

        public void SubscribeToChannel(Subscription newSub)
        {
            throw new NotImplementedException();
        }

        public void UnsubscribeToChannel(Subscription sub)
        {
            throw new NotImplementedException();
        }

        public void UpdateVideoElectionRating(int electionId, int value)
        {
            throw new NotImplementedException();
        }

        public void VoteChannel(int channelID, int vote)
        {
            throw new NotImplementedException();
        }

        public void VoteVideo(int userID, int videoID, int vote)
        {
            throw new NotImplementedException();
        }

        public void Test()
        {
            
        }
    }
}
